package cn.cvs.dao;

import cn.cvs.pojo.SysUser;

import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
// 方式二    extends SqlSessionDaoSupport》》   return getSqlSession().getMapper(SysUserMapper.class).findAll();
import java.util.List;

public class SysUserMapperImpl  implements SysUserMapper{

    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public List<SysUser> findAll() {
        SysUserMapper mapper = sqlSession.getMapper(SysUserMapper.class);
        return mapper.findAll();
    }

    public SysUser findId(Integer id) {

        SysUserMapper mapper = sqlSession.getMapper(SysUserMapper.class);
        return mapper.findId(id);
    }


}
